package com.base.sweb.utils;

import android.os.Environment;

import java.io.File;

/**
 * Created by weikailiang on 2019/2/26.
 */

public class ToolsUtils {
    private static boolean hasSDCard = Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED);

    private static String getAppDir() {

        if (hasSDCard) { // SD卡根目录的hello.text
            return Environment.getExternalStorageDirectory() + "/image/";
        } else {  // 系统下载缓存根目录的hello.text
            return Environment.getDownloadCacheDirectory() + "/image/";
        }
    }

    private static String mkdirs(String dir) {
        File file = new File(dir);
        if (!file.exists()) {
            file.mkdirs();
        }
        return dir;
    }

    public static String getApkDir() {
        return getAppDir();
    }
}
